home *** CD-ROM | disk | FTP | other *** search
/ Champak 147 / (Vol 147) Jan 21 2012.iso / Interface / mod.000 / scripts / __Packages / mx / controls / RadioButtonGroup.as < prev    next >
Text File  |  2012-01-21  |  6KB  |  232 lines

  1. class mx.controls.RadioButtonGroup
  2. {
  3.    static var symbolName = "RadioButtonGroup";
  4.    static var symbolOwner = mx.controls.RadioButtonGroup;
  5.    static var version = "2.0.2.126";
  6.    var className = "RadioButtonGroup";
  7.    var indexNumber = 0;
  8.    function RadioButtonGroup()
  9.    {
  10.       this.init();
  11.       mx.events.UIEventDispatcher.initialize(this);
  12.    }
  13.    function init(Void)
  14.    {
  15.       this.radioList = new Array();
  16.    }
  17.    function setGroupName(groupName)
  18.    {
  19.       if(groupName == undefined || groupName == "")
  20.       {
  21.          return undefined;
  22.       }
  23.       var _loc6_ = this.__groupName;
  24.       _parent[groupName] = this;
  25.       for(var _loc5_ in this.radioList)
  26.       {
  27.          this.radioList[_loc5_].groupName = groupName;
  28.          var _loc3_ = this.radioList[_loc5_];
  29.       }
  30.       _loc3_.deleteGroupObj(_loc6_);
  31.    }
  32.    function getGroupName()
  33.    {
  34.       return this.__groupName;
  35.    }
  36.    function addInstance(instance)
  37.    {
  38.       instance.indexNumber = this.indexNumber++;
  39.       this.radioList.push(instance);
  40.    }
  41.    function getValue()
  42.    {
  43.       if(this.selectedRadio.data == "")
  44.       {
  45.          return this.selectedRadio.label;
  46.       }
  47.       return this.selectedRadio.__data;
  48.    }
  49.    function getLabelPlacement()
  50.    {
  51.       for(var _loc3_ in this.radioList)
  52.       {
  53.          var _loc2_ = this.radioList[_loc3_].getLabelPlacement();
  54.       }
  55.       return _loc2_;
  56.    }
  57.    function setLabelPlacement(pos)
  58.    {
  59.       for(var _loc3_ in this.radioList)
  60.       {
  61.          this.radioList[_loc3_].setLabelPlacement(pos);
  62.       }
  63.    }
  64.    function setEnabled(val)
  65.    {
  66.       for(var _loc3_ in this.radioList)
  67.       {
  68.          this.radioList[_loc3_].enabled = val;
  69.       }
  70.    }
  71.    function setSize(val, val1)
  72.    {
  73.       for(var _loc3_ in this.radioList)
  74.       {
  75.          this.radioList[_loc3_].setSize(val,val1);
  76.       }
  77.    }
  78.    function getEnabled()
  79.    {
  80.       for(var _loc4_ in this.radioList)
  81.       {
  82.          var _loc2_ = this.radioList[_loc4_].enabled;
  83.          var _loc3_ = t + (_loc2_ + 0);
  84.       }
  85.       if(_loc3_ == this.radioList.length)
  86.       {
  87.          return true;
  88.       }
  89.       if(_loc3_ == 0)
  90.       {
  91.          return false;
  92.       }
  93.    }
  94.    function setStyle(name, val)
  95.    {
  96.       for(var _loc4_ in this.radioList)
  97.       {
  98.          this.radioList[_loc4_].setStyle(name,val);
  99.       }
  100.    }
  101.    function setInstance(val)
  102.    {
  103.       for(var _loc3_ in this.radioList)
  104.       {
  105.          if(this.radioList[_loc3_] == val)
  106.          {
  107.             this.radioList[_loc3_].selected = true;
  108.          }
  109.       }
  110.    }
  111.    function getInstance()
  112.    {
  113.       return this.selectedRadio;
  114.    }
  115.    function setValue(val)
  116.    {
  117.       for(var _loc4_ in this.radioList)
  118.       {
  119.          if(this.radioList[_loc4_].__data == val || this.radioList[_loc4_].label == val)
  120.          {
  121.             var _loc2_ = _loc4_;
  122.             break;
  123.          }
  124.       }
  125.       if(_loc2_ != undefined)
  126.       {
  127.          this.selectedRadio.setState(false);
  128.          this.selectedRadio.hitArea_mc._height = this.selectedRadio.__height;
  129.          this.selectedRadio.hitArea_mc._width = this.selectedRadio.__width;
  130.          this.selectedRadio = this.radioList[_loc2_];
  131.          this.selectedRadio.setState(true);
  132.          this.selectedRadio.hitArea_mc._height = this.selectedRadio.hitArea_mc._width = 0;
  133.       }
  134.    }
  135.    function set groupName(groupName)
  136.    {
  137.       if(groupName == undefined || groupName == "")
  138.       {
  139.          return undefined;
  140.       }
  141.       var _loc6_ = this.__groupName;
  142.       _parent[groupName] = this;
  143.       for(var _loc5_ in this.radioList)
  144.       {
  145.          this.radioList[_loc5_].groupName = groupName;
  146.          var _loc3_ = this.radioList[_loc5_];
  147.       }
  148.       _loc3_.deleteGroupObj(_loc6_);
  149.    }
  150.    function get groupName()
  151.    {
  152.       return this.__groupName;
  153.    }
  154.    function set selectedData(val)
  155.    {
  156.       for(var _loc4_ in this.radioList)
  157.       {
  158.          if(this.radioList[_loc4_].__data == val || this.radioList[_loc4_].label == val)
  159.          {
  160.             var _loc2_ = _loc4_;
  161.             break;
  162.          }
  163.       }
  164.       if(_loc2_ != undefined)
  165.       {
  166.          this.selectedRadio.setState(false);
  167.          this.selectedRadio = this.radioList[_loc2_];
  168.          this.selectedRadio.setState(true);
  169.       }
  170.    }
  171.    function get selectedData()
  172.    {
  173.       if(this.selectedRadio.data == "" || this.selectedRadio.data == undefined)
  174.       {
  175.          return this.selectedRadio.label;
  176.       }
  177.       return this.selectedRadio.__data;
  178.    }
  179.    function get selection()
  180.    {
  181.       return this.selectedRadio;
  182.    }
  183.    function set selection(val)
  184.    {
  185.       for(var _loc3_ in this.radioList)
  186.       {
  187.          if(this.radioList[_loc3_] == val)
  188.          {
  189.             this.radioList[_loc3_].selected = true;
  190.          }
  191.       }
  192.    }
  193.    function set labelPlacement(pos)
  194.    {
  195.       for(var _loc3_ in this.radioList)
  196.       {
  197.          this.radioList[_loc3_].setLabelPlacement(pos);
  198.       }
  199.    }
  200.    function get labelPlacement()
  201.    {
  202.       for(var _loc3_ in this.radioList)
  203.       {
  204.          var _loc2_ = this.radioList[_loc3_].getLabelPlacement();
  205.       }
  206.       return _loc2_;
  207.    }
  208.    function set enabled(val)
  209.    {
  210.       for(var _loc3_ in this.radioList)
  211.       {
  212.          this.radioList[_loc3_].enabled = val;
  213.       }
  214.    }
  215.    function get enabled()
  216.    {
  217.       var _loc2_ = 0;
  218.       for(var _loc3_ in this.radioList)
  219.       {
  220.          _loc2_ += this.radioList[_loc3_].enabled;
  221.       }
  222.       if(_loc2_ == 0)
  223.       {
  224.          return false;
  225.       }
  226.       if(_loc2_ == this.radioList.length)
  227.       {
  228.          return true;
  229.       }
  230.    }
  231. }
  232.